package com.ymatou.iapi.freightservice.service;

import java.util.Arrays;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import com.ymttest.business.YmatouAutoTestCall;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.JsonBeanHelper;
import com.ymttest.utils.MapUtil;

public class GetFreightTemplatesCall extends YmatouAutoTestCall {
	private static String opurl="/GetFreightTemplates";
	
	public GetFreightTemplatesCall(){
		super(EnvSetup.getSystemUrl("freightservice"), opurl, "POST", "JSON");
	}
	
	
	@Override
	public void addDefHeader(){
		client.addHeader("Content-Type", "application/json");
	}
	
	 public JSONObject getFreightTemplates(List<Integer> templateIds){
		 JSONObject requestBean = this.getJsonBean(null);
			
		JsonBeanHelper.updateJsonBean(requestBean, MapUtil.hashMap("ids", new JSONArray(templateIds)));
			
		return callAndGetReturnData(requestBean);
	 }
	

	
	public static void main(String[] args) {
		new GetFreightTemplatesCall().getFreightTemplates(Arrays.asList(1));
	}
}
